<?php
/*
|
|--------------------------------------------------------------------------
| RSS 订阅
|--------------------------------------------------------------------------
|
*/
include 'includes/common.php';
include 'ss-config.php';
include 'includes/ss-db.php';
include 'includes/functions.php';
include 'class/RSS.php';

//检索全部文章
$query = sprintf('SELECT ID, CAT_ID, ART_TITLE, ART_CONTENT, UNIX_TIMESTAMP(SUBMIT_DATE) AS SUBMIT_DATE FROM %sarticles WHERE IS_DELETE = 0 ORDER BY SUBMIT_DATE DESC', DB_TBL_PREFIX);

mysql_query("set names 'utf8'");
$result = mysql_query($query, $GLOBALS['DB']) or die(mysql_error($GLOBALS['DB']));

$title = '孟村县井霸井盖厂';
$link = 'http://www.jinggaichangjia.com';
$description = '复合井盖,树脂井盖专业厂家';

$rss = new RSS($title, $link, $description);

while($row = mysql_fetch_array($result))
{  
	$title = $row['ART_TITLE'];
	$link = 'http://www.jinggaichangjia.com/xinwen-view-'.$row['ID'].'.html';
	$description = strip_tags(str_intercept($row['ART_CONTENT'], 150));
	$pubDate = date('Y-m-d', $row['SUBMIT_DATE']);

	$rss->AddItem($title, $link, $description, $pubDate);
}

mysql_free_result($result);

$rss->Fetch();
$rss->Display();
?>